local ScreenName = Var "LoadingScreen";
local stageDisplayTypes = {
	ScreenSelectCourse = "selmusic",
	ScreenSelectCourseNonstop = "selmusic",
	ScreenSelectCourseOni = "selmusic",
	ScreenSelectCourseEndless = "selmusic",
	ScreenGameplay = "selmusic",
	ScreenGameplayRave = "selmusic",
	ScreenGameplayCourse = nil,
	ScreenGameplayCourseNonstop = nil,
	ScreenGameplayCourseOni = nil,
	ScreenGameplayCourseEndless = nil,
	ScreenGameplayExtra = "selmusic",
	ScreenGameplayExtra = "selmusic",
	ScreenDemonstration = nil,
	ScreenJukebox = nil,
	ScreenEvaluation = "selmusic",
	ScreenEvaluationStage = "selmusic",
	ScreenEvaluationRave = "selmusic",
	ScreenEvaluationExtra = "selmusic",
	ScreenEvaluationExtra2 = "selmusic",
	ScreenEvaluationNonstop = "selmusic",
	ScreenEvaluationOni = "selmusic",
	ScreenEvaluationEndless = "selmusic",
};
local stageDisplayType = stageDisplayTypes[ScreenName];
if stageDisplayType == nil then return Def.Actor{}; end;

local StageDisplay = Def.ActorFrame{
	BeginCommand=cmd(playcommand,"Set";);
	CurrentSongChangedMessageCommand=cmd(finishtweening;playcommand,"Set";);
};

	for s in ivalues(Stage) do
		StageDisplay[#StageDisplay+1] = LoadActor( THEME:GetPathG("","_stages/_"..stageDisplayType.." "..s) ) .. {
			SetCommand=function(self, params)
				local Stage = GAMESTATE:GetCurrentStage();
				local StageIndex = GAMESTATE:GetCurrentStageIndex();
				local screen = SCREENMAN:GetTopScreen();
				if screen and screen.GetStageStats then
					local ss = screen:GetStageStats();
					Stage = ss:GetStage();
					StageIndex = ss:GetStageIndex();
				end
				self:visible( Stage == s );
			end;
		}
	end

return StageDisplay;